package controller.comparator;

import java.util.*;

import entity.Bid;

/**
 * Compares Bid object by
 * <ol>
 * <li>Alphabetical order of user id</li>
 * </ol>
 * 
 */
public class BidComparatorByUserId implements Comparator<Bid> {

	public int compare(Bid bid, Bid anotherBid) {
		int k = 0;

		/*
		 * Compare user id in ascending order
		 */
		String userId = bid.getStudent().getUserId();
		String anotherUserId = anotherBid.getStudent().getUserId();
		k = AlphanumComparator.compareTo(userId, anotherUserId);

		return k;
	}

}
